One of the most popular pieces of telephone equipment presently on the market is the speakerphone, a device which allows "handsfree" operation by utilizing a microphone and a loudspeaker to receive and transmit voice information or other sounds. Although speakerphones have been in existence for many years, they typically suffer from certain drawbacks which often make their use difficult or inconvenient. More particularly, because its microphone and loudspeaker are located in close physical proximity (often together in a small unit), the speakerphone is highly susceptible to interference from echoes caused by sounds generated by the loudspeaker and received by the nearby microphone and other noise generated by both acoustic and electrical sources. In addition, speakerphone systems are susceptible to electrical echoes. An electrical echo is generated when a portion of the electrical signal which represents the acoustical information is "reflected" as the signal travels along the electrical circuit and the reflected portion of the signal travels back to its source.
Acoustic echoes occur because sounds generated by the loudspeaker are detected by the microphone and transmitted back over the telephone line. The sounds generated by the speaker reach the microphone either directly or by reflections from the walls of the room in which the phone is located. One method of eliminating acoustic echoes is to utilize a "half-duplex" system in which either the speaker or the microphone is active, but both devices are not active at the same time. In such an arrangement, a circuit monitors the microphone output and turns off the speaker for a predetermined period of time when the microphone has detected a sound. Similarly, if the speaker is active, the microphone is disabled for a predetermined period of time.
Half duplex systems suffer from a problem that only one person of a two-person conversation can speak at any given time and, even then, the first syllable or two of speech is often "clipped" or lost due to the "dead" time interval that occurs when the microphone switches from the inactive state to the active state. When a half-duplex speakerphone is connected to a conventional handset phone, the clipping problem is acceptable, but when two such speakerphones are connected together, it is often very difficult to converse without losing a significant amount of information. In order to overcome the problems associated with half-duplex speakerphones, "full-duplex" speakerphones have been used in which both the microphone and the speaker are operational at all times, but such systems are extremely susceptible to acoustic echoes.
FIG. 1 is a schematic block diagram which illustrates how both acoustic and electrical echoes are generated in a speakerphone system. In particular, FIG. 1 shows a schematic representation of a full-duplex speakerphone consisting of a speaker 104 and a microphone 120 connected to telephone circuitry 106. The speaker 104 and the microphone 120 are located in a room 102 and the telephone circuit 106 is, in turn, connected by means of a two- wire receiving leg 108 and a two-wire transmitting leg 122 to a hybrid circuit 124. The hybrid circuit 124 converts the four-wire circuit, comprising legs 108 and 122, to a two-wire line 125. At the other end of the telephone line, a similar hybrid circuit 114 converts the two-wire line 125 back into a four-wire circuit comprising a receiving leg 112 and a transmitting leg 128.
An acoustic echo is generated when a sound emanating from the speaker 104 is transmitted into the microphone 120 (for example, by reflection from the room walls 103) and is heard by the person at the other end of the phone line 125. Since there are typically a variety of paths by which a sound generated by speaker 104 can reach microphone 120, many acoustic echoes can be generated from the same initial sound. Three such echo paths (paths 100, 116 and 118) are illustrated in FIG. 1. The echoes are annoying to the person at the far end.
As previously mentioned, an electrical echo is generated in the speakerphone system when a portion of the electrical signal transmitted from the near end is reflected back by impedance discontinuities in the electrical circuit and the reflected portion of the signal travels back to its source.
Acoustic and electrical echoes are particularly annoying when two persons are conversing over speakerphones because the echoes from a previously uttered phrase often arrive as a person has begun speaking a new phrase. Consequently, in most speakerphone systems, and, in particular, full-duplex speakerphone systems, adaptive filters are used to reduce the echoes to an acceptable level.
Specifically, at the near end, the signal reaching the loudspeaker is also applied to an adaptive filter whose output is subtracted from the electrical output of the microphone. The filter is adjusted automatically to provide a transfer function close to identical with that of the path through the loudspeaker and microphone by way of the acoustical coupling between those components. The subtractive process thus eliminates, or greatly reduces, the acoustic feedback signal in the microphone output. The same arrangement is used to cancel electrical echoes by applying the electrical signal generated by the microphone to a second adaptive filter whose output is subtracted from the signal going out to the loudspeaker. A typical adaptive filter used in speakerphone systems is called an adaptive finite-impulse-response (AFIR) filter which is comprised of a tapped delay line that generates signals that are selectively combined to generate the filter output.
FIG. 2 shows the telephone circuitry in an illustrative speakerphone (corresponding to a portion of circuitry 106 in FIG. 1)in which two digital AFIR filters are used as echo cancelers to cancel both acoustic and electrical echoes. In the illustrated circuit, AFIR filter 212 is used as an acoustic echo canceler and AFIR filter 216 is used as an electrical echo canceler. The microphone input 200 is provided to an analog-to-digital converter 202 where it is sampled at the Nyquist rate to generate a plurality of digital samples over time. These samples are provided to a summer 204 where the correction signal output 213 of the AFIR filter 212 is subtracted to generate the echo-corrected signal. This latter signal is provided over bus 206 to digital-to-analog converter 210 and reconverted back to analog form for transmission over the telephone lines attached to line output 208. An error signal, derived from the corrected signal, is also fed back to the AFIR filter 212, via bus 214, in order to adaptively adjust the filter coefficients in a known manner to cause the filter to adapt to changes in the echo generating mechanisms as discussed above.
In a similar manner, signals received at the line input 230 are provided to an analog-to-digital converter 228 for conversion into digital form. The digital signals are, in turn, provided to a summer 226 which subtracts the correction signals generated by electrical echo corrector filter 216. The digital output samples (for line and speaker) are converted to analog signals using digital-to-analog converter 222. The corrected signal is also fed back to AFIR filter 216 via bus 218 in order to adaptively adjust the filter coefficients as explained above for AFIR filter 212.
More specifically, a typical finite-impulse-response (FIR)filter is a linear filter, preferably in the form of a tapped delay line. Each tap has associated with it a "weight" which modifies the characteristic of the filter. If the delay line has only feed-forward delays, its transfer function can be expressed as a single polynomial in Z.sup.-1 and the filter's impulse response is limited to a finite number of points; therefore, it has a finite impulse response.
An adaptive finite impulse response (AFIR) filter is an FIR filter with provision for automatic adjustment of its tap weights. FIG. 3 shows an AFIR filter with a least-mean-squared (LMS) algorithm used for adapting the tap weights which filter is used, in this example, as an echo canceler. A plurality of received digital signal samples, A(k), which are typically samples derived from an analog signal sampled at, or above, the Nyquist rate, is introduced to the filter at the input 310. This signal is used as a reference signal to develop an estimate of the echo to be canceled and the signal is applied to successive delay units 300, 302, etc. until the "end" of the filter at delay unit 308 is reached.
Each of the delays: 300, 302, 304, 306, 308 and any additional (but not illustrated) delays, produces a delayed version of the signal which is provided to it and the delayed signal version is passed on to the next delay unit. The delayed versions of the signal (illustrated as signals A.sub.1 -A.sub.N) are also fed to multipliers 312, 314, 316, 318, through 320 where they are multiplied by associated tap weights C1, C2, C3, C4, through C.sub.N. The multiplier outputs are fed into summer 322 where they are added to produce, in the case of an echo cancellation application, the filter output which is an estimate of the echo.
The echo estimate, S(k), is subtracted from the signal R(k), which is the desired (echo-free) signal corrupted by the echo, by adder 330. The output of adder 330, E(k), is used as an estimate of the desired signal 326 and comprises the actual desired signal plus whatever residual error exists between the estimate of the echo S(k), and the actual echo signal.
The desired signal estimate E(k)is also used to modify the tap weights, that is, adapt the FIR filter, generally by means of an algorithm as shown at 328. The particular algorithm illustrated in box 328 is a least mean squares (LMS) algorithm which computes the tap weight for a given sample (C.sub.i (k+1)) using the tap weight used with the previous sample (C.sub.i (k)) plus a correction factor which consists of a product of a convergence constant (.beta.), the delayed signal from the previous sample (A.sub.i (k)) and the estimated signal from the previous sample time (E(k)). This adaptation reduces the signal error attributable to echoes and adjusts to changing conditions which modify the echo characteristics.
FIG. 4 shows an illustrative flow chad for operating an AFIR filter such as that shown in FIG. 3. The process begins at step 400 and proceeds to step 402 where the next sample, corresponding to a sampled version of a reference signal 310 of FIG. 3, is retrieved. Then an echo estimate is generated at step 404 using an FIR filter. An input sample, corresponding to the desired output sample plus an echo contribution is then retrieved at step 406. The estimated output is calculated at step 408 and is used at step 410 to update the tap weights (C.sub.n) associated with the AFIR. At step 412, the echo-canceled signal, E(t), is output. At this point, the routine is complete, as illustrated by step 414.
AFIR filters can be used as illustrated in FIGS. 2 and 3 to reduce both acoustic and electrical echoes in speakerphones, however, such filters cannot be designed to optimize echo reduction in every environment. In particular, in prior art designs, the length, or the number of taps in the AFIR filter is fixed by the circuit designer and this length directly affects the capacity of the filter to cancel echoes in selected environments.
For example, in environments where long-delayed echoes are present, a filter with a long delay line or many taps produces optimal echo reduction since it may be necessary to delay the reference signal by a long time delay in order to generate an accurate echo estimate. On the other hand, when a filter with a long delay line is used in environments where the echo delay time is shod, the taps at the end on the delay line contribute very little to the echo estimate and increase quantization noise in the output. Consequently, a circuit which is to operate in many different environments must necessarily be a compromise design and, therefore, may not be optimal in any given environment or in environments which change over time.
Accordingly, it is an object of the present invention to provide echo cancellation circuits which improve echo cancellation over prior art echo cancellation circuits.
It is another object of the present invention to provide echo cancellation circuits which automatically adjust the length of the AFIR filter delay line in order to cancel echoes optimally in most environments.